import axios from 'axios';
import {baseUrl} from './config';

axios.interceptors.response.use(
  data => {
    return data;
  },
  error => {
    if (error.response.status === 509) {
      let html = error.response.data;
      let verifyWindow = window.open("", "_blank", "height=400,width=560,resizable=no,location=no");
      verifyWindow.document.write(html);
      verifyWindow.document.getElementById("baseUrl").value = baseUrl;
    }
  }
);

export default axios;